package com.ten.stat.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ten.stat.vo.EduSubjectVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：王薪伟
 * @date ：Created in 2022/12/9 14:58
 * @description：
 * @modified By：
 * @version:
 */
public interface OrderDao extends BaseMapper<EduSubjectVo> {

    @Select(value = "SELECT su.title, COUNT(su.parent_id) AS count FROM edu_subject s " +
            "JOIN (SELECT * FROM edu_subject WHERE parent_id = '0') su " +
            "ON su.id = s.parent_id GROUP BY s.parent_id")
    List<EduSubjectVo> selectTitle();
}
